All Questions
Tagged with umlcomposition
12 questions
0votes
3answers
1kviews
How to solve a circular dependency with a composition relation?
For a game I'm making I have two objects; Gun and ReloadSystem. At the moment, these two object reference each other. Gun tells ReloadSystem to perform a reload when the gun gets clicked, and ...
5votes
3answers
230views
UML Composition parent association end
The Wikipedia article on the Composite Design Pattern includes the following diagram: As you see, there is an association relationship which is child 0..* – 1 parent (association). However, shouldn't ...
1vote
1answer
692views
UML Composition parent multiplicity
The Wikipedia article on the Composite Design Pattern includes the following diagram: As you see, there is an association relationship which is child 0..* – 1 parent. However, given that: a ...
1vote
4answers
139views
Class Diagram - Aggregating over a class that has physical presence or logical presence?
In the below figure, a CD shop has CD cupboards, and inside it has shelves. CDs could be rented, and class CD Copy represents the actual CDs that are rented. My question is, should I represent Shelves ...
11votes
4answers
4kviews
Can a class contain its own class?
Suppose I have the following class structure: A forest can have any number of trees, but each tree can belong to only one forest. If the forest is deleted, the tree is deleted. A tree must have at ...
2votes
1answer
1kviews
How to design a social media follower/followed relation with UML?
I am working on a UML diagram for social media website like Facebook: The main class of this system is User, which has members as userid, email, phone, address, Friends, etc. A user may follow a set ...
1vote
1answer
79views
Is this form generator a valid Composite GoF?
Searching for a good PHP real world example, I've found this example of "composite" using: FormElement as Component Fieldset and Form as Containers Input as Leaf (this is my UML from the code): So, ...
0votes
2answers
167views
Modelling 2 composition relationships between 2 XML elements using UML
I want to model an XML schema that has the following composition relationships: A can contain B, and in another case B can contain A. Using a bi-directional composition is not an option here as it is ...
1vote
2answers
513views
Composition - legal class diagram
I wanted to ask if this is a valid class diagram: I tend to think not, because it forces a certain wheel to belong to two vehicles at the same time (because of the 1 multiplicity). If the ...
5votes
6answers
976views
What is the correct OOP relation between complex and real numbers?
On one hand class complex { double real; double imaginary; } it is composition on the other hand class complex : double { double imaginary; } it is inheritance Which one is correct? Why ...
0votes
1answer
1kviews
In UML is it correct to have an association class with a composition or aggregation relationship?
An example of an association class is given here: http://pic.dhe.ibm.com/infocenter/rsarthlp/v9/index.jsp?topic=%2Fcom.ibm.xtools.modeler.doc%2Ftopics%2Fcassnclss.html Composition and Aggregation ...
5votes
6answers
2kviews
Understanding UML composition better
The difference between Composition and Aggregation in UML (and sometimes in programming too) is that with Composition, the lifetime of the objects composing the composite (e.g. an engine and a ...